package com.rg1906.web;

import java.io.IOException;
import java.sql.SQLException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import com.alibaba.fastjson.JSON;
import com.rg1906.entity.LoginUser;
import com.rg1906.service.impl.QueryRoleServiceImpl;


@WebServlet("/QueryRole")
public class QueryRole extends HttpServlet {
	private static final long serialVersionUID = 1L;
  
	QueryRoleServiceImpl service=new QueryRoleServiceImpl();
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
	
	try {
		List<com.rg1906.entity.QueryRole> list = service.queryList();
		String jsonString = JSON.toJSONString(list);
		response.getWriter().print(jsonString);
	} catch (SQLException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
	
	
	
	
	
	}

	
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		doGet(request, response);
	}

}
